﻿using System;
using System.IO;

namespace LabSolutions
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = null;
            using (StreamReader sr = new StreamReader("input.txt"))
            {
                input = sr.ReadToEnd();
            }
            double a = double.Parse(input);
            double z1 = Math.Pow(Math.Cos(3d / 8d * Math.PI - a / 4), 2) - Math.Pow(Math.Cos(11d / 8d * Math.PI + a / 4), 2);
            double z2 = Math.Sqrt(2) / 2 * Math.Sin(a / 2);
            using (StreamWriter sw = new StreamWriter("output.txt"))
            {
                sw.WriteLine(z1.ToString("0.00000"));
                sw.Write(z2.ToString("0.00000"));
            }            
        }
    }
}
